package com.ruoyi.grade.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.grade.domain.entity.Student;
import com.ruoyi.grade.mapper.StudentMapper;
import com.ruoyi.grade.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student>
    implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;


    @Override
    public Boolean checkStudentIdExist(String studentId) {
        //设置查询条件
        LambdaQueryWrapper<Student> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Student::getStudentId, studentId);
        return studentMapper.selectOne(lqw) != null;
    }
}
